import { h } from 'vue'

export const collectionConfig = {
  headList: [
    {
      label: '集合名称',
      prop: 'collectionName'
    },
    {
      label: '字段',
      prop: 'fields',
      slot: true,
      render: (row) => {
        const names = row.fields.map(item => item.name).join(',')
        return h(
          'span',
          names
        )
      }
    },
    {
      label: '创建时间',
      prop: 'created_at'
    },
    {
      label: '更新时间',
      prop: 'updated_at'
    },
    {
      label: '描述',
      prop: 'description'
    }
  ]
}

export const documentConfig = {
  headList: [
    {
      label: '文档名称',
      prop: 'name'
    },
    {
      label: '创建时间',
      prop: 'created_at'
    },
    {
      label: '更新时间',
      prop: 'updated_at'
    },
    {
      label: '描述',
      prop: 'description'
    }
  ]
}
